<?php /*a:2:{s:65:"D:\apps\phpstudy_pro\WWW\tp25\app\admin\view\goods\good_list.html";i:1618365602;s:63:"D:\apps\phpstudy_pro\WWW\tp25\app\admin\view\common\header.html";i:1615942745;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>商品管理-[keywords]</title>
    <link rel="stylesheet" href="/static/css/pintuer.css">
    <link rel="stylesheet" href="/static/css/admin.css">
    <script src="/static/js/jquery.js"></script>

<script src="/static/js/pintuer.js"></script>
<body>
<div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong> <a href="" style="float:right; display:none;">添加字段</a>
    </div>
    <div class="padding border-bottom">
        <form action="<?php echo url(''); ?>" id="F" method="get">
            <ul class="search" style="padding-left:10px;">
                <li><a class="button border-main icon-plus-square-o" href="<?php echo url('goodAdd'); ?>"> 添加内容</a></li>
                <li>搜索：</li>
                <li>
                    开始时间：<input type="date" name="start_time">
                    结束时间：<input type="date" name="end_time">
                </li>
                <li>

                    全部: <input type="radio" name="recommended" <?php if($recommended == ''): ?>checked<?php endif; ?>  value="">
                    推荐: <input type="radio" name="recommended"  <?php if($recommended == '1'): ?>checked<?php endif; ?> value="1">
                    不推荐: <input type="radio" name="recommended"  <?php if($recommended == '0'): ?>checked<?php endif; ?> value="0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    上架：<input type="checkbox" name="if_show[]" <?php if(in_array(1,$if_show)): ?>checked<?php endif; ?>  value="1">
                    下架：<input type="checkbox" name="if_show[]" <?php if(in_array(0,$if_show)): ?>checked<?php endif; ?> value="0">
                </li>
                <li>
                    <select name="cid" style="padding:5px 15px; border:1px solid #ddd;">
                        <option value="">请选择分类</option>
                        <?php if(is_array($cate) || $cate instanceof \think\Collection || $cate instanceof \think\Paginator): if( count($cate)==0 ) : echo "" ;else: foreach($cate as $key=>$v): ?>
                        <optgroup label="<?php echo htmlentities($v['cate_name']); ?>">
                            <?php if(!empty($v['next'])): if(is_array($v['next']) || $v['next'] instanceof \think\Collection || $v['next'] instanceof \think\Paginator): if( count($v['next'])==0 ) : echo "" ;else: foreach($v['next'] as $key=>$vv): ?>
                            <optgroup label="|--<?php echo htmlentities($vv['cate_name']); ?>">
                                <?php if(!empty($vv['next'])): if(is_array($vv['next']) || $vv['next'] instanceof \think\Collection || $vv['next'] instanceof \think\Paginator): if( count($vv['next'])==0 ) : echo "" ;else: foreach($vv['next'] as $key=>$vvv): ?>
                                <option value="<?php echo htmlentities($vvv['cate_id']); ?>">|----<?php echo htmlentities($vvv['cate_name']); ?></option>
                                <?php endforeach; endif; else: echo "" ;endif; ?>
                                <?php endif; ?>
                            </optgroup>
                            <?php endforeach; endif; else: echo "" ;endif; ?>
                            <?php endif; ?>
                        </optgroup>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </li>
                <li>
                    <select name="brand_id" id="" style="padding:5px 15px; border:1px solid #ddd;">
                        <option value="">请选择品牌</option>
                        <?php if(is_array($brand) || $brand instanceof \think\Collection || $brand instanceof \think\Paginator): if( count($brand)==0 ) : echo "" ;else: foreach($brand as $key=>$vo): ?>
                        <option value="<?php echo htmlentities($vo['brand_id']); ?>"><?php echo htmlentities($vo['brand_name']); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </li>
                <li>
                    <input class="input" type="text" value="<?php echo htmlentities($keywords); ?>" placeholder="请输入搜索关键字" name="keywords" style="width:200px; line-height:17px;display:inline-block"/>
                    <a href="javascript:F.submit();" class="button border-main icon-search"> 搜索</a>
                </li>
            </ul>
        </form>
    </div>
    <table class="table table-hover text-center">
        <tr>
            <th>ID</th>
            <th>商品名称</th>
            <th>图片</th>
            <th>价格</th>
            <th>分类名称</th>
            <th>品牌名称</th>
            <th><a href="<?php echo url('?order='.$order,$data); ?>">上架时间<?php echo htmlentities($msg); ?></a></th>
            <th>推荐</th>
            <th>热门</th>
            <th>下架</th>
            <th>操作</th>
        </tr>
        <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): if( count($list)==0 ) : echo "" ;else: foreach($list as $key=>$vo): ?>
        <tr>
            <td><input type="checkbox" name="id[]" value=""/><?php echo htmlentities($vo['goods_id']); ?></td>
            <td><?php echo $vo['goods_name']; ?></td>
            <td><img src="/img/<?php echo htmlentities($vo['default_image']); ?>" alt="" width="70" height="50"/></td>
            <td><?php echo htmlentities($vo['price']); ?></td>
            <td><?php echo htmlentities($vo['cate_id']); ?></td>
            <td><?php echo htmlentities($vo['brand']); ?></td>
            <td><?php echo htmlentities(date("Y-m-d H:i:s",!is_numeric($vo['add_time'])? strtotime($vo['add_time']) : $vo['add_time'])); ?></td>
            <td><img width="50" src="/static/images/data/<?php echo $vo['recommended']==1 ? 'yes.jpg' : 'no.jpg'; ?>" alt=""></td>
            <td><img width="50" src="/static/images/data/<?php echo $vo['if_hot']==1 ? 'yes.jpg' : 'no.jpg'; ?>" alt=""></td>
            <td><img width="50" src="/static/images/data/<?php echo $vo['if_show']==1 ? 'yes.jpg' : 'no.jpg'; ?>" alt=""></td>
            <td>
                <div class="button-group"><a class="button border-main" href="<?php echo url('goodEdit?goods_id='.$vo['goods_id'],input('get.')); ?>"><span
                        class="icon-edit"></span> 修改</a> <a class="button border-red" href="javascript:void(0)"
                                                            onclick="return del(1,1,1)"><span
                        class="icon-trash-o"></span> 删除</a></div>
            </td>
        </tr>
        <?php endforeach; endif; else: echo "" ;endif; ?>
        <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>
            全选
        </td>
        <td colspan="9" style="text-align:left;padding-left:20px;">
            <a href="javascript:void(0)" class="button border-red icon-trash-o"    style="padding:5px 15px;" onclick="DelSelect()">删除</a>
            <a href="javascript:void(0)" style="padding:5px 15px; margin:0 10px;"  class="button border-blue icon-edit" onclick="sorts()"> 排序</a>
            操作：
            <select name="ishome" style="padding:5px 15px; border:1px solid #ddd;" onchange="changeishome(this)">
                <option value="">首页</option>
                <option value="1">是</option>
                <option value="0">否</option>
            </select>
            <select name="isvouch" style="padding:5px 15px; border:1px solid #ddd;" onchange="changeisvouch(this)">
                <option value="">推荐</option>
                <option value="1">是</option>
                <option value="0">否</option>
            </select>
            <select name="istop" style="padding:5px 15px; border:1px solid #ddd;" onchange="changeistop(this)">
                <option value="">下架</option>
                <option value="1">是</option>
                <option value="0">否</option>
            </select>
        </td>
        </tr>
    </table>
    <?php echo $list; ?>
</div>
<script type="text/javascript">

    //搜索
    function changesearch() {

    }

    //单个删除
    function del(id, mid, iscid) {
        if (confirm("您确定要删除吗?")) {

        }
    }

    //全选
    $("#checkall").click(function () {
        $("input[name='id[]']").each(function () {
            if (this.checked) {
                this.checked = false;
            } else {
                this.checked = true;
            }
        });
    })

    //批量删除
    function DelSelect() {
        var Checkbox = false;
        $("input[name='id[]']").each(function () {
            if (this.checked == true) {
                Checkbox = true;
            }
        });
        if (Checkbox) {
            var t = confirm("您确认要删除选中的内容吗？");
            if (t == false) return false;
            $("#listform").submit();
        } else {
            alert("请选择您要删除的内容!");
            return false;
        }
    }

    //批量排序
    function sorts() {
        var Checkbox = false;
        $("input[name='id[]']").each(function () {
            if (this.checked == true) {
                Checkbox = true;
            }
        });
        if (Checkbox) {

            $("#listform").submit();
        } else {
            alert("请选择要操作的内容!");
            return false;
        }
    }


    //批量首页显示
    function changeishome(o) {
        var Checkbox = false;
        $("input[name='id[]']").each(function () {
            if (this.checked == true) {
                Checkbox = true;
            }
        });
        if (Checkbox) {

            $("#listform").submit();
        } else {
            alert("请选择要操作的内容!");

            return false;
        }
    }

    //批量推荐
    function changeisvouch(o) {
        var Checkbox = false;
        $("input[name='id[]']").each(function () {
            if (this.checked == true) {
                Checkbox = true;
            }
        });
        if (Checkbox) {


            $("#listform").submit();
        } else {
            alert("请选择要操作的内容!");

            return false;
        }
    }

    //批量置顶
    function changeistop(o) {
        var Checkbox = false;
        $("input[name='id[]']").each(function () {
            if (this.checked == true) {
                Checkbox = true;
            }
        });
        if (Checkbox) {

            $("#listform").submit();
        } else {
            alert("请选择要操作的内容!");

            return false;
        }
    }


    //批量移动
    function changecate(o) {
        var Checkbox = false;
        $("input[name='id[]']").each(function () {
            if (this.checked == true) {
                Checkbox = true;
            }
        });
        if (Checkbox) {

            $("#listform").submit();
        } else {
            alert("请选择要操作的内容!");

            return false;
        }
    }

    //批量复制
    function changecopy(o) {
        var Checkbox = false;
        $("input[name='id[]']").each(function () {
            if (this.checked == true) {
                Checkbox = true;
            }
        });
        if (Checkbox) {
            var i = 0;
            $("input[name='id[]']").each(function () {
                if (this.checked == true) {
                    i++;
                }
            });
            if (i > 1) {
                alert("只能选择一条信息!");
                $(o).find("option:first").prop("selected", "selected");
            } else {

                $("#listform").submit();
            }
        } else {
            alert("请选择要复制的内容!");
            $(o).find("option:first").prop("selected", "selected");
            return false;
        }
    }

</script>
</body>
</html>